package com.yc.design.mode.factorymethod;

import com.yc.design.mode.factorymethod.simplefactory.SimpleConcreateFactory;

public class Clinet {
    public static void main(String[] args) {
        //工厂方法模式
        Creator creator=new ConcreteCreator();
        Product product1=creator.createProduct(ConcreteProduct1.class);
        product1.method2();
        Product product2=creator.createProduct(ConcreteProduct2.class);
        product2.method2();
        //简单工厂方法模式
        Product product3=SimpleConcreateFactory.createProduct(ConcreteProduct1.class);
        Product product4=SimpleConcreateFactory.createProduct(ConcreteProduct2.class);
        product3.method2();
        product4.method2();
    }
}
